package com.dmyang.user.service;

import com.dmyang.user.dao.TeacherMapper;
import com.dmyang.user.entity.Teacher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by brss on 2017/7/20.
 */
@Service("userServiceImpl")
public class UserServiceImpl implements UserService {

    @Autowired
    private TeacherMapper teacherMapper;

    @Override
    @Transactional
    public int createTeacher(Teacher teacher) {

        Teacher teacher1 = new Teacher();
        teacher1.setTid(15);
        teacher1.setTname("s");

        teacherMapper.insertSelective(teacher);
        teacherMapper.insertSelective(teacher1);
        return 0;
    }
}
